<?php 

namespace App\Repositories;

class WebPermissionRepository extends Repository 
{
    public function model() 
    {
        return 'App\Models\WebPermission';
    }  

    public function updatePermission($data, $orderId)
    {
    	$result = $this->findBy('order_id', $orderId);

    	if ($result) {
    		return $result->update($data, $result->id);
    	}

    	$data['order_id'] = $orderId;

    	return $this->create($data);
    }
}